 /*
  * The contents of this file are subject to the Mozilla Public License
  * Version 1.1 (the "License");  you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
  * http//www.mozilla.org/MPL/
  *
  * Software distributed under the License is distributed on an "AS IS" basis,
  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
  * the specific language governing rights and limitations under the License.
  *
  * The Original Code is ART OWL API.
  *
  * The Initial Developer of the Original Code is University of Roma Tor Vergata.
  * Portions created by University of Roma Tor Vergata are Copyright (C) 2009.
  * All Rights Reserved.
  *
  * The ART OWL API were developed by the Artificial Intelligence Research Group
  * (art.uniroma2.it) at the University of Roma Tor Vergata
  * Current information about the ART OWL API can be obtained at 
  * http://art.uniroma2.it/owlart
  *
  */

package it.uniroma2.art.owlart.model.impl;

import java.util.UUID;

import it.uniroma2.art.owlart.model.ARTBNode;
import it.uniroma2.art.owlart.model.ARTLiteral;
import it.uniroma2.art.owlart.model.ARTNode;
import it.uniroma2.art.owlart.model.ARTNodeFactory;
import it.uniroma2.art.owlart.model.ARTResource;
import it.uniroma2.art.owlart.model.ARTStatement;
import it.uniroma2.art.owlart.model.ARTURIResource;

public class ARTNodeFactoryImpl implements ARTNodeFactory {

	public ARTLiteral createLiteral(String label) {
		return new ARTLiteralEmptyImpl(label);
	}

	public ARTLiteral createLiteral(String label, String language) {
		return new ARTLiteralEmptyImpl(label, language);
	}

	public ARTLiteral createLiteral(String label, ARTURIResource datatype) {
		return new ARTLiteralEmptyImpl(label, datatype);
	}

	public ARTURIResource createURIResource(String uri) {
		return new ARTURIResourceEmptyImpl(uri);
	}

	//TODO check somehow if the node has not been already created, though...with respect to what? a given repo? this implementation should be repo-agnostic...
	public ARTBNode createBNode() {
		return new ARTBNodeEmptyImpl(
			UUID.randomUUID().toString().split("-")[0]
		);
	}

	public ARTBNode createBNode(String ID) {
		return new ARTBNodeEmptyImpl(ID);
	}

	public ARTStatement createStatement(ARTResource subject, ARTURIResource predicate, ARTNode object) {
		return new ARTStatementEmptyImpl(subject, predicate, object);
	}

	
}
